//
//  TPAPITestViewController.m
//  TPAPITest
//
//  Created by David J. Hinson on 1/15/10.
//  Copyright TweetPhoto, Inc. 2010. All rights reserved.
//
// This controller will test the API calls for the TweetPhoto API, as specified here: http://groups.google.com/group/tweetphoto/web

#import "TPAPITestViewController.h"
#import "TweetPhoto.h"

@implementation TPAPITestViewController

@synthesize tweetPhoto;

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
	
#pragma mark ---- Setup the TweetPhoto Class Object ----
	
	// Setup TweetPhoto
	[self setupTweetPhoto];

#pragma mark ---- Serialized (Structured Data) Calls to the API ---	
	
	// Sign In
	Profile * profile = [self.tweetPhoto signIn];
	 if (profile) {
		NSLog(@"Sign In: %@", profile);
		[profile release];
	} else {
		NSLog(@"Login Error.  Status Code: %d", tweetPhoto.statusCode);
		}
	
	// Link a service for the currently auth'd user.  Can only link services with oAuth Tokens or FB Connect Session Key / Session Secret
	// [self decodeNSData:[self.tweetPhoto linkService:self.tweetPhoto.apiKey serviceName:@"Facebook_or_Twitter_or_Foursquare" identityToken:@"your_identity_token" identitySecret:@"your_identity_secret"] description:@"Linked a Service"];
	
	// Un-Link a service for the currently auth'd user
	// [self decodeNSData:[self.tweetPhoto unlinkService:@"Facebook"] description:@"Unlink Facebook from currently auth'd user"];
	
	// Get Profiles with Linked Servics - Raw NSData; LinkedServices tag contains space delimited services that are currently linked.
	// [self decodeNSData:[self.tweetPhoto getLinkedServices] description:@"Get Profile with Linked Services"];
	
	// Get Profiles with Linked Services - Serialized into a Profiles structure; .linkedServices contains space delimited services that are currently linked.
	// Profiles * profiles = [self.tweetPhoto linkedServices];
	// NSLog(@"Profile with Linked Services: %@", profiles);
	
	// Social (Public)
	// SocialFeed * sf = [self.tweetPhoto social:10 ind:1 sort:TweetPhotoSortDesc];
	// NSLog(@"Social Feed: %@", sf);
	
	// Social (User Id)
	// SocialFeed * sf = [self.tweetPhoto social:2733857 ps:10 ind:1 sort:TweetPhotoSortDesc];
	// NSLog(@"Social Feed: %@", sf);
	
	// Photo Upload
	// TweetPhotoResponse * tr = [self.tweetPhoto photoUpload:UIImageJPEGRepresentation([UIImage imageNamed:@"16.png"], 0.5) comment:@"Da Mona Lisa" tags:@"sample, test, standalone api, and such..." latitude:24.559614 longitude:-81.783085];
	// NSLog(@"Photo Upload: %@", tr);
	
	// User Profile by ID
	// Profile * profileDos = [self.tweetPhoto userProfileById:2733857];
	// NSLog(@"User Profile By ID: %@", profileDos);

	// User Profile by User Name
	// Profile * profileTres = [self.tweetPhoto userProfileByName:@"davidjhinson"];
	// NSLog(@"User Profile By User Name: %@", profileTres);
	
	// User Has Voted
	// VoteStatus * hasVoted = [self.tweetPhoto userHasVoted:2733857 photoId:8748839];
	// NSLog(@"Has Voted: %@", hasVoted);
	
	// User Settings
	// Settings * settings = [self.tweetPhoto userSettings:2733857];
	// NSLog(@"User Settings: %@", settings);

	// Photos
	// Photos * photos = [self.tweetPhoto photos];
	// NSLog(@"%@", photos);
	
	// Photos by User Id
	// Photos * photos = [self.tweetPhoto photos:2733857];
	// NSLog(@"%@", photos);

	// Get Photos with Parms
	// Photos * photos = [self.tweetPhoto photos:2733857 ind:3 ps:7 sf:TweetPhotoSortFilterDate tags:@"" sort:TweetPhotoSortDesc size:TweetPhotoSizeThumbnail];
	// NSLog(@"%@", photos);
	
	// Photo Metadata
	// Photo * photo = [self.tweetPhoto photoMetaData:8748839];
	// NSLog(@"%@", photo);
	
	// Get Photo Previous and Next
	// Photo * photo = [self.tweetPhoto previous:8748839 photoId:8738998];
	// NSLog(@"%@", photo);
	
	// photo = [self.tweetPhoto next:8748839 photoId:8738998];
	// NSLog(@"%@", photo);

	// Photo Leaderboard - DOUBLECHECK
	// Photos * photos = [self.tweetPhoto leaderboard:TweetPhotoLeaderboardTypeViewed];
	// NSLog(@"%@", photos);
	
	// Friends by User Id - NOT RECOMMENDED - MANY USERS HAVE THOUSANDS OF FRIENDS!!!
	// Profiles * profiles = [self.tweetPhoto friends:2733857];
	// NSLog(@"%@", profiles);

	// Friends by Parms
	// Profiles * profiles = [self.tweetPhoto friends:2733857 ind:0 ps:3 sort:TweetPhotoSortDesc];
	// NSLog(@"%@", profiles);
	
	// All Comments for a User
	// Comments * comments = [self.tweetPhoto comments:2733857];
	// NSLog(@"%@", comments);

	// All Comments for a User with Parms
	// Comments * comments = [self.tweetPhoto comments:2733857 ind:3 ps:4 sortType:TweetPhotoSortDesc];
	// NSLog(@"%@", comments);
	
	// User Comments
	// Comments * comments = [self.tweetPhoto userComments:2733857];
	// NSLog(@"%@", comments);

	// User Comments by Parms
	// Comments * comments = [self.tweetPhoto userComments:2733857 ind:3 ps:5 sort:TweetPhotoSortDesc];
	// NSLog(@"%@", comments);

	// Photo Comments by Photo Id
	// Comments * comments = [self.tweetPhoto photoComments:8748839];
	// NSLog(@"%@", comments);

	// Photo Comments by Parms
	// Comments * comments = [self.tweetPhoto photoComments:8748839 ind:2 ps:3 sort:TweetPhotoSortAsc];
	// NSLog(@"%@", comments);

	// Favorites by User Id
	// Favorites * favorites = [self.tweetPhoto favorites:2733857];
	// NSLog(@"%@", favorites);

	// Favorites by Parms
	// Favorites * favorites = [self.tweetPhoto favorites:2733857 ind:2 ps:7 sort:TweetPhotoSortAsc];
	// NSLog(@"%@", favorites);
	
#pragma mark --- Low Level API Calls ---
	
	// Test Sign In
	// [self testSignIn];
	
	// Test Social (Public)
	// [self testSocial];
	
	// Test Get Favorites
	// [self testGetFavorites];
	
	// Test Votes
	// [self testVotes];
	
	// Test Settings
	// [self testSettings];
	
	// Get Feeds
	// [self testFeeds];
	
	// Test Get Comments
	// [self testGetComments];
	
	// Test Get Friends
	// [self testGetFriends];
	
	// Test Set / Delete Location
	// [self testSetLocation];
	
	// Test Get Next / Previous
	// [self testGetNextPrevious];
	
	// Test Delete Photo
	// [self testDeletePhoto];
	
	// Get Photo Meta Data
	// [self testGetPhotoMetaData];
	
	// Test Get User Settings
	// [self testGetUserSettings];
	
	// Test Add View
	// [self testAddView];
	
	// Test Favorites
	// [self testFavorites];
	
	// Test Upload
	// [self testUpload];
	
	// Delete comments
	// [self testDeleteComment];
	
	// Test Add Comment
	// [self testAddComment];
	
	// Get Photos
	// [self testPhotos];
	
	// Test Get Profile
	// [self testGetProfile];
	
	// Test Leaderboards
	// [self testLeaderboards];
	
	NSLog(@"\n\n___\n\nEnd\n\n___\n\n");
}

// Test Social
-(void)testSocial {
	[self decodeNSData:[self.tweetPhoto getSocial:10 ind:1 sort:TweetPhotoSortDesc returnType:TweetPhotoSocialReturnTypeJSON] description:@"getSocial (Public)"];
	[self decodeNSData:[self.tweetPhoto getSocial:907516 ps:10 ind:2 sort:TweetPhotoSortDesc returnType:TweetPhotoSocialReturnTypeXML] description:@"getSocial (User Id)"];
}

// Test Feeds
-(void)testFeeds {
	[self decodeNSData:[self.tweetPhoto getFeed:@"davidjhinson" feedType:TweetPhotoFeedTypeATOM] description:@"getFeed ATOM"];
	[self decodeNSData:[self.tweetPhoto getFeed:@"davidjhinson" feedType:TweetPhotoFeedTypeRSS] description:@"getFeed RSS"];
}

// Test Get Comments
-(void)testGetComments {
	[self decodeNSData:[self.tweetPhoto getComments:907516 returnType:TweetPhotoCommentsReturnTypeXML] description:@"getPhotoComments XML"];
	[self decodeNSData:[self.tweetPhoto getComments:907516 returnType:TweetPhotoCommentsReturnTypeJSON] description:@"getPhotoComments JSON"];
	[self decodeNSData:[self.tweetPhoto getComments:907516 ind:1 ps:5 sort:TweetPhotoSortDesc returnType:TweetPhotoCommentsReturnTypeXML] description:@"getPhotoComments XML"];
	[self decodeNSData:[self.tweetPhoto getComments:8882641 ind:3 ps:7 sort:TweetPhotoSortAsc returnType:TweetPhotoCommentsReturnTypeJSON] description:@"getPhotoComments JSON"];
	
	[self decodeNSData:[self.tweetPhoto getPhotoComments:8882641 returnType:TweetPhotoCommentsReturnTypeXML] description:@"getPhotoComments XML"];
	[self decodeNSData:[self.tweetPhoto getPhotoComments:8882641 returnType:TweetPhotoCommentsReturnTypeJSON] description:@"getPhotoComments JSON"];
	[self decodeNSData:[self.tweetPhoto getUserComments:907516 returnType:TweetPhotoCommentsReturnTypeXML] description:@"getUserComments XML"];
	[self decodeNSData:[self.tweetPhoto getUserComments:907516 returnType:TweetPhotoCommentsReturnTypeJSON] description:@"getUserComments JSON"];
}

// Test Get Friends
-(void)testGetFriends {
	// Not recommended you get all friends, as many people have thousands of friends
	// [self decodeNSData:[self.tweetPhoto getFriends:907516 returnType:TweetPhotoFriendsReturnTypeXML] description:@"getFriends XML"];
	// [self decodeNSData:[self.tweetPhoto getFriends:907516 returnType:TweetPhotoFriendsReturnTypeJSON] description:@"getFriends JSON"];
	[self decodeNSData:[self.tweetPhoto getFriends:907516 ind:2 ps:7 sort:TweetPhotoSortAsc returnType:TweetPhotoFriendsReturnTypeXML] description:@"getFriends (vars) XML"];
	[self decodeNSData:[self.tweetPhoto getFriends:907516 ind:3 ps:8 sort:TweetPhotoSortDesc returnType:TweetPhotoFriendsReturnTypeJSON] description:@"getFriends (vars) JSON"];
}

// Test Get Favorites
-(void)testGetFavorites {
	[self decodeNSData:[self.tweetPhoto getFavorites:907516 returnType:TweetPhotoFavoritesReturnTypeXML] description:@"getFavorites XML"];
	[self decodeNSData:[self.tweetPhoto getFavorites:907516 returnType:TweetPhotoFavoritesReturnTypeJSON] description:@"getFavorites JSON"];
	[self decodeNSData:[self.tweetPhoto getFavorites:907516 ind:2 ps:7 sort:TweetPhotoSortAsc returnType:TweetPhotoFavoritesReturnTypeXML] description:@"getFavorites XML"];
	[self decodeNSData:[self.tweetPhoto getFavorites:907516 ind:3 ps:5 sort:TweetPhotoSortDesc returnType:TweetPhotoFavoritesReturnTypeJSON] description:@"getFavorites JSON"];
}

// Test Set Location
-(void)testSetLocation {
	[self decodeNSData:[self.tweetPhoto setLocation:8738998 lat:24.558834 lon:-81.782398 returnType:TweetPhotoLocationReturnTypeXML] description:@"setLocation XML"];
	[self decodeNSData:[self.tweetPhoto setLocation:8738998 lat:24.558834 lon:-81.782398 returnType:TweetPhotoLocationReturnTypeJSON] description:@"setLocation JSON"];
	
	[self decodeNSData:[self.tweetPhoto deleteLocation:8738998 returnType:TweetPhotoLocationReturnTypeXML] description:@"deleteLocation XML"];
	[self decodeNSData:[self.tweetPhoto deleteLocation:8738998 returnType:TweetPhotoLocationReturnTypeJSON] description:@"deleteLocation JSON"];
}

-(void)testGetNextPrevious {
	[self decodeNSData:[self.tweetPhoto getNext:907516 photoId:8738998 returnType:TweetPhotoReturnTypeXML] description:@"getNext XML"];
	[self decodeNSData:[self.tweetPhoto getNext:907516 photoId:8738998 returnType:TweetPhotoReturnTypeJSON] description:@"getNext JSON"];
	[self decodeNSData:[self.tweetPhoto getPrevious:907516 photoId:8738998 returnType:TweetPhotoReturnTypeXML] description:@"getPrevious XML"];
	[self decodeNSData:[self.tweetPhoto getPrevious:907516 photoId:8738998 returnType:TweetPhotoReturnTypeJSON] description:@"getPrevious JSON"];
}

// Test Delete Photo
-(void)testDeletePhoto {
	[self decodeNSData:[self.tweetPhoto deletePhoto:8773604 returnType:TweetPhotoDeletePhotoReturnTypeXML] description:@"deletePhoto XML"];
	[self decodeNSData:[self.tweetPhoto deletePhoto:8739711 returnType:TweetPhotoDeletePhotoReturnTypeJSON] description:@"deletePhoto JSON"];
}

// Test Get Photo Meta Data
-(void)testGetPhotoMetaData {
	[self decodeNSData:[self.tweetPhoto getPhotoMetaData:8748839 returnType:TweetPhotoPhotoReturnTypeXML] description:@"getPhotoMetaData XML"];
	[self decodeNSData:[self.tweetPhoto getPhotoMetaData:8748839 returnType:TweetPhotoPhotoReturnTypeJSON] description:@"getPhotoMetaData JSON"];
}

// Test Get User Setting
-(void)testGetUserSettings {
	[self decodeNSData:[self.tweetPhoto getUserSettings:907516 returnType:TweetPhotoSettingsReturnTypeXML] description:@"getUserSettings XML"];
	[self decodeNSData:[self.tweetPhoto getUserSettings:907516 returnType:TweetPhotoSettingsReturnTypeJSON] description:@"getUserSettings JSON"];
}

// Test Settings
-(void)testSettings {
	[self decodeNSData:[self.tweetPhoto setPin:907516 pin:1234] description:@"Set PIN"];
	[self decodeNSData:[self.tweetPhoto setShortenUrl:907516 shorten:TRUE] description:@"Set ShortenUrl"];
	[self decodeNSData:[self.tweetPhoto setHideViewingPatterns:907516 hideView:FALSE] description:@"Set HideViewingPatterns"];
	[self decodeNSData:[self.tweetPhoto setDoNotTweetFavoritePhoto:907516 fave:TRUE] description:@"Set DoNotTweetFavoritePhoto"];
	[self decodeNSData:[self.tweetPhoto setHideVotes:907516 hideVote:TRUE] description:@"Set HideVotes"];
	[self decodeNSData:[self.tweetPhoto setMapType:907516 mapType:1] description:@"Set MapType"];
}

// Test Add View
-(void)testAddView {
	[self.tweetPhoto photoView:907516 photoId:8707663];
	[self.tweetPhoto photoView:907516 photoId:8707816];
}

// Test Votes
-(void)testVotes {
	[self decodeNSData:[self.tweetPhoto vote:8707663 voteType:TweetPhotoVoteTypeThumbsUp returnType:TweetPhotoVoteReturnTypeXML] description:@"ThumbsUp XML"]; 
	[self decodeNSData:[self.tweetPhoto vote:8707816 voteType:TweetPhotoVoteTypeThumbsDown returnType:TweetPhotoVoteReturnTypeJSON] description:@"ThumbsUp JSON"];  
	[self decodeNSData:[self.tweetPhoto hasVoted:907516 photoId:8707663 returnType:TweetPhotoHasVotedReturnTypeXML] description:@"hasVoted XML"]; 	
	[self decodeNSData:[self.tweetPhoto hasVoted:907516 photoId:8707816 returnType:TweetPhotoHasVotedReturnTypeJSON] description:@"hasVoted JSON"]; 	
}

// Test Favorites
-(void)testFavorites {
	[self.tweetPhoto favoriteAdd:907516 photoId:8773604];
	[self.tweetPhoto favoriteDelete:907516 photoId:8773604];
}

// Test Upload
-(void)testUpload {
	[self decodeNSData:[self.tweetPhoto upload:UIImageJPEGRepresentation([UIImage imageNamed:@"16.png"], 0.5) comment:@"Da Mona Lisa" tags:@"sample, test, standalone api, and such..." latitude:0.0 longitude:0.0 returnType:TweetPhotoUploadReturnTypeXML] description:@"upload XML"];
	[self decodeNSData:[self.tweetPhoto upload:UIImageJPEGRepresentation([UIImage imageNamed:@"16.png"], 0.5) comment:@"Da Mona Lisa" tags:@"sample, test, standalone api, and such..." latitude:0.0 longitude:0.0 returnType:TweetPhotoUploadReturnTypeJSON] description:@"upload JSON"];
}

// Test Add Comment
-(void)testAddComment {
	NSString * comment = @"Testing standalone API...";
	[self decodeNSData:[self.tweetPhoto comment:907516 photoId:8748839 comment:comment returnType:TweetPhotoCommentReturnTypeXML] description:@"Test Add Comment XML"];
	[self decodeNSData:[self.tweetPhoto comment:907516 photoId:8748839 comment:comment returnType:TweetPhotoCommentReturnTypeJSON] description:@"Test Add Comment XML"];
}

// Test Delete Comment
-(void)testDeleteComment {
	[self.tweetPhoto commentDelete:907516 photoId:8748839 commentId:2193191];
	[self.tweetPhoto commentDelete:907516 photoId:8748839 commentId:2193193];
}

// Test Sign In
-(void)testSignIn {
	[self decodeNSData:[self.tweetPhoto apiSignIn:TweetPhotoSignInReturnTypeJSON] description:[NSString stringWithFormat:@"signin:TweetPhotoSignInReturnTypeJSON (Status Code: %d)", self.tweetPhoto.statusCode]];
	[self decodeNSData:[self.tweetPhoto apiSignIn:TweetPhotoSignInReturnTypeXML] description:[NSString stringWithFormat:@"signin:TweetPhotoSignInReturnTypeXML (Status Code: %d)", self.tweetPhoto.statusCode]];
}

// Test Setup TweetPhoto
-(void)setupTweetPhoto {
	
	// Setup the priviledged connection to TweetPhoto.  Valid Services are Twitter, Foursquare, and Facebook.
	self.tweetPhoto = [[TweetPhoto alloc] initWithSetup:@"username" identitySecret:@"password" apiKey:@"yourapikeyhere" serviceName:@"Twitter" isoAuth:NO];
	
	// self.tweetPhoto = [[TweetPhoto alloc] init];
	
	// self.tweetPhoto.apiKey         = @"yourapikeyhere";
	// self.tweetPhoto.identityToken  = @"username";
	// self.tweetPhoto.identitySecret = @"password";
	// self.tweetPhoto.isoAuth        = NO;
	// self.tweetPhoto.serviceName    = @"Twitter";
}

-(void)testPhotos {
	// Get All Photos
	[self decodeNSData:[self.tweetPhoto getPhotos:TweetPhotoReturnTypeATOM] description:@"getPhotos:TweetPhotoReturnTypeATOM"];
	[self decodeNSData:[self.tweetPhoto getPhotos:TweetPhotoReturnTypeJSON] description:@"getPhotos:TweetPhotoReturnTypeJSON"];
	[self decodeNSData:[self.tweetPhoto getPhotos:TweetPhotoReturnTypeRSS] description:@"getPhotos:TweetPhotoReturnTypeRSS"];
	[self decodeNSData:[self.tweetPhoto getPhotos:TweetPhotoReturnTypeXML] description:@"getPhotos:TweetPhotoReturnTypeXML"];

	// Get User Photos
	[self decodeNSData:[self.tweetPhoto getPhotos:907516 returnType:TweetPhotoReturnTypeJSON] description:@"getPhotos:907516 TweetPhotoReturnTypeJSON"];
	[self decodeNSData:[self.tweetPhoto getPhotos:907516 returnType:TweetPhotoReturnTypeXML] description:@"getPhotos:907516 TweetPhotoReturnTypeXML"];
		
	// Get User Photos, Parameterized
	[self decodeNSData:[self.tweetPhoto getPhotos:907516 ind:1 ps:5 sf:TweetPhotoSortFilterViews tags:@"" sort:TweetPhotoSortAsc size:TweetPhotoSizeAll returnType:TweetPhotoReturnTypeJSON] description:@"getPhotos:907516 TweetPhotoReturnTypeJSON"];
	[self decodeNSData:[self.tweetPhoto getPhotos:907516 ind:3 ps:7 sf:TweetPhotoSortFilterDate tags:@"" sort:TweetPhotoSortDesc size:TweetPhotoSizeThumbnail returnType:TweetPhotoReturnTypeXML] description:@"getPhotos:907516 TweetPhotoReturnTypeXML"];
}

// Test Get Profile
-(void)testGetProfile {	
	// Get Profile By User Name
	[self decodeNSData:[self.tweetPhoto getUserProfileByName:@"davidjhinson" returnType:TweetPhotoReturnTypeXML] description:@"getUserProfileByName XML"];
	[self decodeNSData:[self.tweetPhoto getUserProfileByName:@"davidjhinson" returnType:TweetPhotoReturnTypeJSON] description:@"getUserProfileByName JSON"];
	
	// Get Profile By User Id
	[self decodeNSData:[self.tweetPhoto getUserProfileById:907516 returnType:TweetPhotoReturnTypeXML] description:@"getUserProfileById XML"];
	[self decodeNSData:[self.tweetPhoto getUserProfileById:907516 returnType:TweetPhotoReturnTypeJSON] description:@"getUserProfileById JSON"];
}

// Test Leaderboards
-(void)testLeaderboards {
	// Commented leaderboard
	[self decodeNSData:[self.tweetPhoto getLeaderboard:TweetPhotoLeaderboardTypeCommented returnType:TweetPhotoLeaderboardReturnTypeXML] description:@"getLeaderboard:TweetPhotoLeaderboardTypeCommented XML"];
	[self decodeNSData:[self.tweetPhoto getLeaderboard:TweetPhotoLeaderboardTypeCommented returnType:TweetPhotoLeaderboardReturnTypeJSON] description:@"getLeaderboard:TweetPhotoLeaderboardTypeCommented JSON"];
	
	// Viewed leaderboard
	[self decodeNSData:[self.tweetPhoto getLeaderboard:TweetPhotoLeaderboardTypeViewed returnType:TweetPhotoLeaderboardReturnTypeXML] description:@"getLeaderboard:TweetPhotoLeaderboardTypeViewed XML"];
	[self decodeNSData:[self.tweetPhoto getLeaderboard:TweetPhotoLeaderboardTypeViewed returnType:TweetPhotoLeaderboardReturnTypeJSON] description:@"getLeaderboard:TweetPhotoLeaderboardTypeViewed JSON"];
	
	// Voted leaderboard
	[self decodeNSData:[self.tweetPhoto getLeaderboard:TweetPhotoLeaderboardTypeVoted returnType:TweetPhotoLeaderboardReturnTypeXML] description:@"getLeaderboard:TweetPhotoLeaderboardTypeVoted XML"];
	[self decodeNSData:[self.tweetPhoto getLeaderboard:TweetPhotoLeaderboardTypeVoted returnType:TweetPhotoLeaderboardReturnTypeJSON] description:@"getLeaderboard:TweetPhotoLeaderboardTypeVoted JSON"];
}

-(void)decodeNSData:(NSData*)data description:(NSString*)description {
	NSString *dataStr                    = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
	
	NSString * displayText				 = [NSString stringWithFormat:@"\r\n----\r\n%@:\r\n\n%@\r\n----\r\n\n", description, dataStr];

	NSLog(@"%@", displayText);
	
	[dataStr release];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

- (void)viewDidUnload {
}

- (void)dealloc {
	[TweetPhoto release];
    [super dealloc];
}

@end
